package br.com.controleVendas.entity;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;

public class ParcelaVendaDto extends ParcelaVenda implements GenericDto<ParcelaVenda, ParcelaVendaDto>
{
    private static final long serialVersionUID = -7899858425979685730L;


    @SuppressWarnings("rawtypes")
    @Override
    public Class getClassEntity()
    {
        return ParcelaVenda.class;
    }

    @Override
    public Long getSelecionCdId()
    {
        return getCdId();
    }

    public String getVlParcelaString()
    {
        DecimalFormat df = new DecimalFormat("#.00");
        if(getVlParcela() > 0.00D)
            return "R$ " + df.format(getVlParcela());
        return "R$ 0.00";
    }

    public String getDtVencimentoString()
    {
        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

        if(getDtVencimento() != null)
            return sdf.format(getDtVencimento());
        return "-";
    }
    
    public String getDtPagamentoString()
    {
        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

        if(getDtPagamento() != null)
            return sdf.format(getDtPagamento());
        return "-";
    }
    
    public String getNrSequenciaString(){
    	if(getFlEntrada() != null && getFlEntrada())
    		return "Entrada";
    	return getNrSequencia().toString();
    }


}
